package com.wingsboat.factory;

import com.wingsboat.exception.BeanException;

/**
 * bean工厂
 */
public interface BeanFactory {
    /**
     * 通过beanName获取bean对象
     * @param beanName beanName
     * @return
     */
    Object getBean(String beanName) throws BeanException;


    /**
     * 通过beanName以及构造参数获取bean对象
     * @param beanName beanName
     * @param args constructor args[]
     * @return
     * @throws BeanException
     */
    Object getBean(String beanName, Object... args) throws BeanException;

    /**
     * 容器中beanName为beanName并且属于requiredType类型的Bean实例
     * @param beanName beanName
     * @param requiredType Class<T>
     * @param <T> T
     * @return
     * @throws BeanException
     */
    <T> T getBean(String beanName,Class<T> requiredType) throws BeanException;


}
